package com.concurrent.blockingQueue;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.BlockingQueue;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-05-10 14:26
 */
@Slf4j
public class Consumer implements Runnable {
    private BlockingQueue queue = null;

    public Consumer(BlockingQueue queue) {
        this.queue = queue;
    }

    @Override
    public void run()  {
        try {
            log.info("get {}",queue.take());
            log.info("get {}",queue.take());
            log.info("get {}",queue.take());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
